#ifndef COMBATSCENE_H
#define COMBATSCENE_H

#include<player.h>
#include<box2d/b2_world.h>
#include<box2d/b2_body.h>
#include<contactcontroller.h>
#include<factory.h>
#include<QMediaPlayer>
#include <mainwindow.h>
#include<gamescene.h>
#include<raycastcontroller.h>

#include <shadowfanmask.h>

#include <aientry.h>


typedef enum{
    PVP_MODE,
    PVE_MODE
} GameMode;
class CombatScene : public GameScene
{
public:
    CombatScene();
    void setMode(GameMode mode);
protected:
    void keyPressEvent(QKeyEvent *event) override;
    void keyReleaseEvent(QKeyEvent *event) override;
    void init() override;
    void run() override;
private: 
    Player *p1;
    Player *p2;
    b2World *world;
    QGraphicsPixmapItem *bg;
    ContactController* contactController;
    ContactSignal* contactSignalSender;
    QMediaPlayer* bgm;

//    bool keyPressFlag;
//    bool keyPressFlag2;

     RayCastController* raycastController;
     QLabel * scoreLabel1;
     QLabel * scoreLabel2;
     AIEntry * aien;
     QLabel * hLabel1;
     QLabel * hLabel2;
     QLabel *skillLabel;
     QLabel *skillLabel2;
     QLabel *pointLabel1;
     QLabel *pointLabel2;
     QLabel *pointLabel3;
     QLabel *pointLabel4;
     QLabel *pointLabel5;
     QLabel *pointLabel6;
     QLabel * timerLabel;
     ///游戏倒计时更新的计时器
     QTimer *timer;
     ///倒计时
     int num;
     int mode;

     int score1;
     int score2;
     QTimer* scoreTimer;
     ShadowFanMask* mask1;
     ShadowFanMask* mask2;

private slots:
    void playerInFloor(QString name);
    void playerIsAttacked(QString name);
    void playerIsCombinationAttacked(QString name);
};

#endif // COMBATSCENE_H
